package com.controller;

import com.biz.OrderBiz;
import com.service.StockService;
import com.vo.MergeVO;
import com.vo.StockVO;
import com.vo.req.MergeRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class StockController {
    @Autowired
    StockService stockService;

    @Autowired
    OrderBiz orderBiz;

    @RequestMapping("/test/query/stock/{goodsId}")
    public StockVO save(@PathVariable String goodsId){
        StockVO stockVO = stockService.queryById(goodsId);
        return stockVO;
    }

    @RequestMapping("/test/merge")
    public MergeVO merge(@RequestBody MergeRequest mergeRequest){
        System.out.println("进入");
        MergeVO merge = orderBiz.merge(mergeRequest);
        System.out.println(merge);
        return merge;
    }
}
